<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./react/react18.development.js"></script>
    <script src="./react/react-dom18.development.js"></script>
    <script src="./react/babel.min.js"></script>
</head>

<body>
    <div id="main"></div>
    <script type="text/babel">

        let num = 100;
        let arr = ['aaa','bbb','ccc'];

        function test(){
            console.log('----')
        }

        let aaa = (<div className='box'>
            <h2>这是一个标题</h2>
            <p>{num}</p>
            <button onClick={test}>点击</button>

           <ul>
            {arr.map(item=>(<li>{item}</li>))}

            {/* jsx里面的注释*/}
            {arr.map((item,index)=>{
                return(<li key={index}>{item}</li>)
            })}
            </ul>

        </div>);

        var box = document.querySelector('#main');
        var root = ReactDOM.createRoot(box);
        root.render(aaa);
    </script>
</body>

</html>